#! /usr/bin/env node

// let oldName = process.argv[2] && process.argv[2].slice(1);

// let newName = process.argv[3] && process.argv[3].slice(1);

const fs = require('fs');

const path = require('path');
// fs.renameSync(oldName,newName); //重命名

let url = path.join(__dirname,'./src/js');

let list = fs.readdirSync(url);

list.forEach((item,index) => {
    console.log(item)
    let newName = path.join(url,`index${index}.js`);
    let oldName = path.join(url,item);
    fs.renameSync(oldName,newName);//重命名
})

// renameSync(oldPath,newPath)